package com.lsc.blog.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.lsc.blog.pojo.User;
import com.lsc.blog.mapper.UserMapper;
import com.lsc.blog.service.UserService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 上河图
 * @since 2020-10-06
 */
@Service
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public User getId(int id) {

        return userMapper.selectById(id);
    }

    @Transactional
    @Override
    public User getOne(QueryWrapper<User> wrapper) {

        return userMapper.selectOne(wrapper);
    }
}
